const rules = {
	name: {
		rules: [{
			required: true,
			errorMessage: '名称必须填写'
		}, {
			minLength: 2,
			maxLength: 7,
			errorMessage: '名称最少输入2个字符，最多7个字符'
		}]
	},
	path: {
		rules: [{
			required: true,
			errorMessage: '基础路径必须填写'
		}, {
			validateFunction: function(rule, value, data, callback) {
				let vals = value.split('/')
				console.log(vals);
				if (vals.length !== 2) {
					callback('路径输入不符合要求')
				}
				if (vals[0] !== '') {
					callback('路径必须已 / 开头')
				}
				let reg = /^[A-Za-z0-9_\-\@]+$/
				if (!reg.test(vals[1])) {
					callback('路径输入不符合要求，只能输入数字和字母')
				}

				return true
			}
		}]
	}
}
export default {
	rules: rules
}
